package com.google.android.apps.skipbot;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.AbsoluteLayout;

@SuppressWarnings("deprecation")
public class ChangableAbsoluteLayout extends AbsoluteLayout {

  public ChangableAbsoluteLayout(Context context) {
    super(context);
  }

  public ChangableAbsoluteLayout(Context context, AttributeSet attrs) {
    super(context, attrs);
  }

  public ChangableAbsoluteLayout(Context context, AttributeSet attrs,
      int defStyle) {
    super(context, attrs, defStyle);
  }

  public void setOnResizeListener(OnResizeListener listener) {
    this.listener = listener;
  }

  @Override
  protected void onSizeChanged(int xNew, int yNew, int xOld, int yOld) {
    super.onSizeChanged(xNew, yNew, xOld, yOld);

    if (listener != null) {
      listener.OnResize(this.getId(), xNew, yNew, xOld, yOld);
    }
  }

  OnResizeListener listener = null;
}
